/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.gob.pnp.actions;

import com.opensymphony.xwork2.*;
import java.sql.*;
import javax.servlet.http.*;
import java.util.*;
import org.apache.struts2.interceptor.*;
import pe.gob.pnp.despachadores.*;

/**
 *
 * @author Gregorovichz Carlos Rossi
 * @date   15/05/2010
 */
public class ListaDocumentoTramite extends ActionSupport implements ServletRequestAware {

    private static final long serialVersionUID = 1L;
    private List<DocumentoTramite> lstDocumentoTramite;
    private HttpServletRequest servletRequest;

    @Override
    public String execute() {
        try {
            String ntramidentificador = servletRequest.getParameter("ntramidentificador");
            setLstDocumentoTramite(TramiteDespachador.obtenerDocumentosTramite(Integer.parseInt(ntramidentificador)));
        } catch (SQLException ex) {
            ex.printStackTrace();
            return ERROR;
        }
        return SUCCESS;
    }

    /**
     * @return the lstDocumentoTramite
     */
    public List<DocumentoTramite> getLstDocumentoTramite() {
        return lstDocumentoTramite;
    }

    /**
     * @param lstDocumentoTramite the lstDocumentoTramite to set
     */
    public void setLstDocumentoTramite(List<DocumentoTramite> lstDocumentoTramite) {
        this.lstDocumentoTramite = lstDocumentoTramite;
    }

    public void setServletRequest(HttpServletRequest servletRequest) {
        this.servletRequest = servletRequest;
    }
}
